'use strict';

module.exports = appInfo => {
  const config = exports = {};

  config.cluster = {
    listen: {
      port: 7001,
      hostname: '127.0.0.1'
      // path: '/var/run/egg.sock',
    }
  };

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1519791589972_4938';

  // add your config here
  config.middleware = ['compress', 'json'];

  config.apiServiceLocation = {
    product: 'http://121.199.48.143:8002',
    member: 'http://121.199.48.143:8005',
    order: 'http://121.199.48.143:8006',
    shop: 'http://121.199.48.143:8003'
  };

  config.qiniu = {
    accessKey: '4i-VhpjaUerpYaw5_j8JlIyTjGYwxeUDMe5k2qP3',
    secretKey: 'Ax2usNh4f5Vt1xCOyJP0nltDNR-xk2zE58TWftK7',
    bucket: {
      subImg: {
        name: 'image',
        host: 'http://oew2ozpi2.bkt.clouddn.com/',
        zone: 'z1'
      }
    }
  };

  config.security = {
    csrf: false
    // {
    //   ignoreJSON: true // 默认为 false，当设置为 true 时，将会放过所有 content-type 为 `application/json` 的请求
    // }
  };

  // config.cors = {
  //   // allowMethods: 'x-requested-with'
  // };

  config.jwt = {
    secret: '_1519791589972_4938',
    enable: true,
    ignore: ['/menu', '/sign-in', '/products', '/index', '/language']
  };

  return config;
};
